<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>   
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<META HTTP-EQUIV="Refresh" CONTENT="80; URL=HostServlet">
<title>Host</title>
<link rel="stylesheet" type='text/css' href='css/style.css' />
<script type="text/javascript" src="js/rightclick.js"></script>
</head>
<body>

<div class="container" >

	<div id='logoutbar'>
	
	<a href="ChangePassword?home=HostServlet" id="logoutButton" class="">Change Password</a> | <a href="LogoutServlet" id="logoutButton" class="">Logout</a>
	
	</div>

	<table id="maintable">
	
		<tr>

			<td><a href="AddCustomer" id="button1" class="buttonText">Customers</a></td>
			<td><a href="ViewTables" id="button2" class="buttonText">Tables</a></td>

		</tr>
			
		<tr>
		
			<td colspan="2"><a href="Reservation" id="button3" class="buttonText">Reservations</a></td>
		
		</tr>
		
	</table>

	<p>

		<c:choose>
		
			<c:when test = "${ empty reservations[0] }">
			
			No reservations for today.
			
			</c:when>
			
			<c:otherwise>
			
				<table  class="customertable">
				
				<thead>
					<tr>
						<th>Customer Name:</th><th>Reservation Time:</th><th></th>
					</tr>
				</thead>
				
				<tbody>
				
				<c:forEach items = "${ reservations }" var = "reservation">
			
					<tr>
						<td>${ reservation.customerName }</td>
						<td>${ reservation.reservationTime }</td>
						<td id='opaq'><a class='tablebutton' href="HostServlet?removeres=${ reservation.reservationId }">Remove</a></td>
					</tr>
			
				</c:forEach>
				
				</tbody>
				
				</table>
				
			</c:otherwise>
		
		</c:choose>
		
	</p>

</div>
</body>
</html>